import MUtil        from 'util/mm.jsx'

const _mm   = new MUtil();

class Enaserver{
    
  //更具商品ID或用户ID，和时间范围得到评价内容

    getevaList(listParam){
    
         let url     = '',
            data    = {};
          
              data.pageNum                = listParam.pageNum;
              data. poruId = listParam.poruId;  //listParam.prouctId由evaluation目录的index,jsx;loadUserList() 赋值传来。
               data. startTime = listParam.startTime;
                  data. endTime = listParam.endTime;

      if(listParam.searchType === 'prouctId'){
            url = '/manage/order/evasearchp.do';
      
        }else if(listParam.searchType === 'userId'){
            url = '/manage/order/evasearchu.do';
     
        
        }
 
        return _mm.request({
            type    : 'post',
            url     : url,
            data    : data
        });



    }


    //删除评价
    del(evaId){
    
         let url     = '',
            data    = {};
   
            url = '/manage/order/evaalldel.do';
        
            data.evaId = evaId; //data.evaID要何服务器接受保持一致
           

        return _mm.request({
            type    : 'post',
            url     : url,
            data    : data
        });


    }
 //删除单个图片
    delimg(evaId,stringname){
    
         let url     = '',
            data    = {};
   
            url = '/manage/order/evadelimg.do';
        
            data.evaId = evaId; //data.evaID要何服务器接受保持一致
            data.stringname=stringname;
           

        return _mm.request({
            type    : 'post',
            url     : url,
            data    : data
        });


    }
}

export default Enaserver;